package com.jeronimo.eko.core.beans;

import edu.umd.cs.findbugs.annotations.SuppressWarnings;

@Encodable (messageClassId = 135,versionId=1)
@SuppressWarnings(value={"Bx","Dm","UwF","HE","USM","Nm","NP"})
public class BeanTest4 {

	int int1;
	
	Integer Int2;
	
	Short short1;
	
	short Short2;
	
	char char1;
	
	Character Char2;
	
	boolean bool;

	BeanTest3 c1,c2;

	public void initTest1() {
		int1=123;
		Int2 = null;
		short1 =(short) 1234;
		Short2 = Short.valueOf("26466");
		char1 = 'D';
		Char2 = new Character('Z');
		bool = false;
		c1 = new BeanTest3();
		c1.initTest1();
		c2 = new BeanTest3();
		c2.initTest2();
	}


	public void initTest2() {
		int1=123;
		Int2 = null;
		short1 =null;
		Short2 = -4545;
		char1 = 'D';
		Char2 = new Character('E');
		bool = false;

		c1 = null;
		c2 = new BeanTest3();
		c2.initTest2();
	}

	public int getInt1() {
		return int1;
	}

	@EncodableProperty
	public void setInt1(int int1) {
		this.int1 = int1;
	}

	public Integer getInt2() {
		return Int2;
	}

	@EncodableProperty
	public void setInt2(Integer int2) {
		Int2 = int2;
	}

	public Short getShort1() {
		return short1;
	}

	@EncodableProperty
	public void setShort1(Short short1) {
		this.short1 = short1;
	}

	public short getShort2() {
		return Short2;
	}

	@EncodableProperty
	public void setShort2(short short2) {
		Short2 = short2;
	}

	public char getChar1() {
		return char1;
	}

	@EncodableProperty
	public void setChar1(char char1) {
		this.char1 = char1;
	}

	public Character getChar2() {
		return Char2;
	}

	@EncodableProperty
	public void setChar2(Character char2) {
		Char2 = char2;
	}

	public boolean isBool() {
		return bool;
	}

	@EncodableProperty
	public void setBool(boolean bool) {
		this.bool = bool;
	}

	public BeanTest3 getC1() {
		return c1;
	}


	@EncodableProperty
	public void setC1(BeanTest3 c1) {
		this.c1 = c1;
	}


	public BeanTest3 getC2() {
		return c2;
	}


	@EncodableProperty
	public void setC2(BeanTest3 c2) {
		this.c2 = c2;
	}


	@Override
	public boolean equals(Object obj) {
		if (obj instanceof BeanTest4==false) {
			System.out.println("type mismatch btw "+getClass().getName()+" and "+obj.getClass().getName());
			return false;
		}
		BeanTest4 c = (BeanTest4) obj;
		if (c.bool != bool || c.char1!=char1 || c.int1!=int1 || c.Short2!=Short2) {
			System.out.println("simple types does not match in BeanTest4");
			return false;
		}
		if ((Char2==null && c.Char2==null)==false) {
			if (Char2==null || Char2.equals(c.Char2)==false) {
				System.out.println("Charaters does not match in BeanTest4");
				return false;
			}
		}
		if ((short1==null && c.short1==null)==false) {
			if (short1==null || short1.equals(c.short1)==false) {
				System.out.println("Charaters does not match in BeanTest4");
				return false;
			}
		}
		if ((Int2==null && c.Int2==null)==false) {
			if (Int2==null || Int2.equals(c.Int2)==false) {
				System.out.println("Charaters does not match in BeanTest4");
				return false;
			}
		}
		if ((c1==null && c.c1==null)==false) {
			if (c1==null || c1.equals(c.c1)==false) {
				System.out.println("c1 does not match in BeanTest4");
				return false;
			}
		}
		if ((c2==null && c.c2==null)==false) {
			if (c2==null || c2.equals(c.c2)==false) {
				System.out.println("c2 does not match in BeanTest4");
				return false;
			}
		}
		return true;
	}
	
	
}
